using System.Collections.Generic;
using System.Linq;

namespace Flood.FloodStrategies
{
	/// <summary>
	/// moves on the sample set
	/// 24505 in 1.205
	/// </summary>
	public sealed class FloodAdjacentColorThatHasTheMostMoistSquares : IFloodStrategy
	{
		#region IFloodStrategy Members

		public Result GetNextToFlood(IEnumerable<Shape> moistShapes, Grid grid)
		{
			char bestColor = moistShapes
				.OrderByDescending(shape => shape.Parts.Count)
				.First()
				.Color;
			return new Result(bestColor, false);
		}

		#endregion
	}
}